import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop022_删除品牌"
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,'商品管理','商品品牌')
# 删除
n= "苹果"
firefox.find_element_by_xpath("//td[contains(.,'%s')]/following-sibling::td[4]/a[2]"%n).click()
time.sleep(3)
firefox.switch_to.alert.accept()
firefox.refresh()
time.sleep(3)

# 断言
n = firefox.find_element_by_xpath\
    ("/html/body/div[2]/div/div[2]/form/table/tbody/tr/td").text
print(n)
s = "暂无商品品牌"
if n==s:
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
# firefox.quit()